﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace SV
{
    using WS.BLL;
    using WS.DAL;
    using WS.DAL.Entities;
    public class Bussiness
    {
        #region Sanpham
        SanphamBLL _bllSanpham = new SanphamBLL();
        //public Danhmuc Dm = new Danhmuc();

        public DataTable Sanpham_Select()
        {
            return _bllSanpham.Select();
        }

        public object Sanpham_Update(Sanpham obj)
        {
            return _bllSanpham.Update(obj);
        }

        public object Sanpham_Insert(Sanpham obj)
        {
            return _bllSanpham.Insert(obj);
        }

        public object USanpham_Delete(Guid id)
        {
            return _bllSanpham.Delete(id);
        }

        public string Sanpham_Layma()
        {
            return _bllSanpham.Layma();
        }

        //Tìm kiếm
        //Theo loại
        public DataTable Sanpham_Tim_Loai(Guid Loai_Id)
        {
            return _bllSanpham.Sanpham_Tim_Loai(Loai_Id);
        }

        //Theo loại
        public DataTable Sanpham_Tim_NSX(Guid NSX_Id)
        {
            return _bllSanpham.Sanpham_Tim_NSX(NSX_Id);
        }

        //Theo ten
        public DataTable Sanpham_Tim_Ten(string Ten)
        {
            return _bllSanpham.Sanpham_Tim_Ten(Ten);
        }

        public DataTable Sanpham_Tim_Id(Guid Id)
        {
            return _bllSanpham.Sanpham_Tim_Id(Id);
        }
        #endregion

        #region hình sub
        HinhSubBLL _bllHinhSub = new HinhSubBLL();

        public DataTable HinhSub_Select_Sanpham_Id(Guid Sanpham_Id)
        {
            return _bllHinhSub.Select_Sanpham_Id(Sanpham_Id);
        }

        public object HinhSub_Insert(HinhSub obj)
        {
            return _bllHinhSub.Insert(obj);
        }

        public object HinhSub_Delete(Guid id)
        {
            return _bllHinhSub.Delete(id);
        }
        #endregion

        #region Người dùng
        NguoidungBLL _bllNguoidung = new NguoidungBLL();

        public DataTable Nguoidung_Select_Ma(string Ma)
        {
            return _bllNguoidung.Nguoidung_Ma(Ma);
        }

        public object Nguoidung_Update_Pass(object obj)
        {
            return _bllNguoidung.Update(obj);
        }
        #endregion

        #region Dat hang
        DathangBLL _bllDathang = new DathangBLL();
        public string Dathang_Layma(Guid Khachhang_Id)
        {
            return _bllDathang.Maso_Dathang(Khachhang_Id);
        }

        public DataTable Dathang_Lay_Donhangmoinhat(Guid Khachhang_Id)
        {
            return _bllDathang.Lay_Dathang_Moinhat(Khachhang_Id);
        }

        public bool Dathang_Ma_NewOld(Guid Khachhang_Id)
        {
            return _bllDathang.Taomoi_Dungcu_Id(Khachhang_Id);
        }

        public object Dathang_Insert(object obj)
        {
            return _bllDathang.Insert(obj);
        }

        public object Dathang_Update(object obj)
        {
            return _bllDathang.Update(obj);
        }

        #endregion

        #region Chi tiết đặt hàng
        ChitietBLL _bllChitiet = new ChitietBLL();
        public string Chitiet_Layma()
        {
            return _bllChitiet.Layma();
        }

        //public bool Chitiet_Ma_NewOld(Guid Khachhang_Id)
        //{
        //    return _bllChitiet.Taomoi_Dungcu_Id(Khachhang_Id);
        //}

        public object Chitiet_Insert(object obj)
        {
            return _bllChitiet.Insert(obj);
        }

        public object Chitiet_Update(object obj)
        {
            return _bllChitiet.Update(obj);
        }

        #endregion
    }
}
